// 模板中传入自定义数据类型的问题
#include <iostream>
#include <string>
using namespace std;
class Person
{  
public:
    string m_name;
    int m_age;
    Person() {};
    Person(string name, int age): m_name(name), m_age(age) {};
};
template<class T>
bool compare(T &a, T &b)
{
    return a == b;
}
// 对于自定义类的具体化处理
template<> bool compare(Person &p1, Person &p2)
{
    return p1.m_name == p2.m_name && p1.m_age == p2.m_age;
}
void test1()
{
    Person p1("lxy", 20);
    Person p2("lxy", 30);
    cout << compare(p1, p2);
}
int main(void)
{
    test1();

    return 0;
}